/*
 * @file        CCAM_AnimationSet.cpp
 * @version     1.0
 * @author      Johance
 * @email:421465201@qq.com
 * @date        2013-04-24
 * @brief       CCAM_AnimationSet 
 */
#include "CocosPCH.h"

#include "CCAM_AnimationSet.h"
#include "CCAM_Frame.h"


CCAM_AnimationSet *CCAM_AnimationSet::create()
{
	CCAM_AnimationSet *pRet = new CCAM_AnimationSet();
	if(pRet == NULL)
	{
		return NULL;
	}

	pRet->autorelease();

	return pRet;
}

CCAM_AnimationSet::CCAM_AnimationSet()
{
}

CCAM_AnimationSet::~CCAM_AnimationSet()
{
	for(unsigned int i = 0; i < m_vecFrame.size(); i++)
	{
		m_vecFrame[i]->release();
	}
}

void CCAM_AnimationSet::AddFrame(CCAM_Frame *pFrame)
{
	m_vecFrame.push_back(pFrame);
}

int CCAM_AnimationSet::GetFrameCount()
{
    return m_vecFrame.size();
}

void CCAM_AnimationSet::Update(int nCurFrame, Node *pAnimNode)
{
    m_vecFrame[nCurFrame]->Update(pAnimNode);
}

void CCAM_AnimationSet::SetPosScale(float fScale)
{
	for(unsigned int i = 0; i < m_vecFrame.size(); i++)
	{
		m_vecFrame[i]->SetPosScale(fScale);
	}
}